<?php

require_once Kohana::find_file('libraries', 'commonConstant');

class HogeHoge_Model extends LawsBase_Model {

	const TEMP_NAME = 'hogeHoge';

	public function __construct() {
		parent::__construct();
	}

	public function execute(PHPTAL $template) {
		// TODO Lty-Chiba
		// Token Check
		// parent::saveToken();

		// 初期化処理
//		parent::$data['title'] = 'ユーザ登録画面';

		/** ORM 使い方 Start */

		// 参照
//		foreach(ORM::factory(LawsUser_Model::$MODEL_NAME)->find_all() as $lawsUser) {
//			echo $lawsUser->USER_ID . '<br>';
//			echo $lawsUser->USER_NAME . '<br>';
//		}

		// 登録
//		$lawsUser = ORM::factory(LawsUser_Model::$MODEL_NAME);
//		$lawsUser->USER_ID = 'lty003';
//		$lawsUser->USER_NAME = 'hogehoge';
//		$lawsUser->save();

		$loginUser = parent::getUser();

		/** ORM 使い方 End */
		$template->title = 'ユーザ登録画面';
		$template->loginUser = $loginUser['USER_NAME'];

		// ユーザ登録画面のテンプレートを取得
		$template->setSource(parent::$tempStore->getTemplate(C_MAIN_TEMPLATE));
		echo $template->execute();
	}
}